﻿<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<meta http-equiv="Cache-Control" content="no-siteapp" />		
	{include file="public/css"}
	<title>订单管理</title>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>首页<span class="c-gray en">&gt;</span>
		订单管理
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	<div class="page-container">
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<!-- <span class="l">
				<a href="javascript:;" class="btn btn-danger radius delAll">
					<i class="Hui-iconfont">&#xe6e2;</i>
					批量删除
				</a>
				<a class="btn btn-primary radius cardAdd" href="javascript:;" data-id="" data-name="" data-money="">
					<i class="Hui-iconfont">&#xe600;</i>
					添加批次
				</a>
			</span> -->
			<span class="r">
				共有数据：<strong>{:count($list)}</strong>条
			</span>
		</div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
				<thead>
					<tr class="text-c">
						<th width="25"><input type="checkbox" value=""></th>
						<th width="50">ID</th>
						<th>机构名称</th>
						<th>批次</th>
						<th>总人数</th>
						<th>总价格</th>
						<th>实际价格</th>
						<th>订单号</th>
						<th>支付状态</th>
						<th>支付方式</th>
						<th>编辑</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="n"}
					<tr class="text-c">
						<td>
							<input type="checkbox" name="ids" value="{$n.id}">
						</td>
						<td>{$n.id}</td>
						<td>{$n.sname}</td>
						<td>{$n.pname}</td>
						<td>{$n.people_num}</td>
						<td>{$n.all_money}</td>
						<td>{$n.real_money}</td>
						<td>{$n.ordernum}</td>
						<td>{:$n.pay_state==1?'已支付':'未支付'}</td>
						<td>{if condition="$n.pay_state eq 1"}{:$n.pay_type==1?'线下':'线上'}{/if}</td>
						<td class="f-14 td-manage">
							{if condition="$n.pay_state neq 1 && $n.real_money gt 50000"}
							<a style="text-decoration:none" class="ml-5 set-state" href="javascript:;" title="设为已支付" data-id="{$n.id}">
								设为已支付
							</a>
							{/if}
							<!-- <a style="text-decoration:none" class="ml-5 del" href="javascript:;" data-id="{$n.id}" title="删除"> -->
								<!-- <i class="Hui-iconfont">&#xe6e2;</i> -->
							<!-- </a> -->
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			<div class="page">{:$list->render()}</div>
		</div>
	</div>
	<!--_footer 作为公共模版分离出去-->	
	{include file="public/js"}
	<!--/_footer 作为公共模版分离出去-->
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript" src="/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="/admin/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript">
		$('.set-state').click(function(){
			$this=$(this);
			var index=layer.confirm('确定删除数据？',{btn:['确定','取消']},function(){
				layer.close(index);
				var id=$this.attr('data-id');//alert(id);return false;
				if(id!=""){
					$.post("{:url('order')}",{id:id},function(res){
						if(res.code==200){
							layer.msg(res.msg,{icon:1,time:1500},function(){
								window.location.reload();
							})
						}else{
							layer.msg(res.msg,{icon:7,time:1500});
						}
					})
				}else{
					layer.alert('未找到订单信息');
				}
			})
		})
	</script>
</body>
</html>